#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QFont>
#include <QLineEdit>
#include <QPushButton>
#include <QVBoxLayout>
namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
public:
    enum KeyBoardEdit{
            SpecName = 0,
            TesterNo,
            DutNo,
            Renewal,
            User,
            SSID,
            Vendor,
            SpeedValue = 30,
            MM2Value ,
            AWGValue,
            NTValue,
            Retention,
            Holdingtime,
            IpAddr,
            IpPort,
            PASSWD,
            Weight,
            Weight1,
        };
    Q_ENUM(KeyBoardEdit)
public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    Ui::MainWindow *ui;

private:
    QWidget*    InitChartUI();
    QWidget*    InitMotorUI();
    QWidget*    InitAdminUI();
    QWidget*    InitRootUI();
    QWidget*    InitConfigUI();
    QWidget*    InitHelpUI();
    void        DelayInitUIs();
signals:
    void        ReceiveKeyBoardConfigUI(const QString&,const QString&);
    void        ReceiveKeyBoardAdminUI(const QString&,const QString&);
    void        ReceiveKeyBoardChartUI(const QString&,const QString&);
    void        ReceiveKeyBoardRootUI(const QString&,const QString&);
    void        SwitchLang(int);
    void        EnableRootUI(bool);
    void        CalibrateValue(float, int);
private slots:
    void        SwitchUI();
    void        ShowRootUI(bool);
    void        ChangeLanguage(int);
    void        OpenKeyBoard(const QString &, int inputType);
    void        GetKeyBoardDatas(const int type, const QString&);
    void        LoadFunctions();
    void        CheckTimeCode();
    void        EnableSwitchBtn(bool);
private:
    QFont       m_font;
    QWidget     *m_ChartUI;
    QWidget     *m_ConfigUI;
    QWidget     *m_AdminUI;
    QWidget     *m_RootUI;
    QWidget     *m_HelpUI;
    QVBoxLayout *m_vBoxUi;
    QLineEdit   *m_logEdit;
    QMap<QString,QPushButton*> m_SwitchBtns;
    QString     m_BtnName;
    static int         m_LangType;

private:
    QLineEdit   *m_speededit;

};

#endif // MAINWINDOW_H
